<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Administrator
 * Date: 11-7-3
 * Time: 下午10:15
 */

include 'bootstrap.php';

$user_info = Model::getInstance('user')->needLogin();

$user_roles = Model::getInstance('user')->getUserRoles($user_info['user_id']);

$role_ids = array();

if($user_roles){
    foreach($user_roles as $v){
        $role_ids[] = $v['role_id'];
    }
}

if(in_array(4,$role_ids) || in_array(5,$role_ids)){
    $is_test = true;
}else{
    $is_test = false;
}

$data = array(
    'is_test'=>$is_test
);

Template::show('main.php',$data);